package tech.mobi.child;

import tech.mobi.child.base.BaseAct;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

public class CZDAClientMainAct extends BaseAct implements OnClickListener {

	private Button btnBack;
	private Button btnUpload;
	
//	private TextView tvAccount;
//	private ProgressBar progress;

	private RelativeLayout rel_01;
	private RelativeLayout rel_02;

	private RelativeLayout rel_03;
	private RelativeLayout rel_04;
	private RelativeLayout rel_05;
	private RelativeLayout rel_06;
	private RelativeLayout rel_07;
	private RelativeLayout rel_08;
	private RelativeLayout rel_09;
	private RelativeLayout rel_10;
	
	/*****************************
	 * 成长档案类别
			flag=1:我们的一家;
			flag=2:第一天上学;
			flag=3:精彩的瞬间;
			flag=5:舞台上的我;
			flag=7:得意的作品;
			flag=9:欢乐的课堂;
			flag=10:我的好朋友;
			
			以下是显示文字
			flag=4:童言无忌;
			flag=6:喜欢的故事;
			flag=8:教师评语;
	 *****************************/
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.czda_client_main);

//		progress = (ProgressBar) this.findViewById(R.id.progress);
//		tvAccount = (TextView) this.findViewById(R.id.tvAccount);
		btnBack = (Button) this.findViewById(R.id.btnBack);
		btnBack.setOnClickListener(this);
		btnUpload = (Button) this.findViewById(R.id.btnUpload);
		btnUpload.setOnClickListener(this);
		
		rel_01 = (RelativeLayout) this.findViewById(R.id.rel_01);
		rel_01.setOnClickListener(this);
		rel_02 = (RelativeLayout) this.findViewById(R.id.rel_02);
		rel_02.setOnClickListener(this);
		rel_03 = (RelativeLayout) this.findViewById(R.id.rel_03);
		rel_03.setOnClickListener(this);
		rel_04 = (RelativeLayout) this.findViewById(R.id.rel_04);
		rel_04.setOnClickListener(this);
		rel_05 = (RelativeLayout) this.findViewById(R.id.rel_05);
		rel_05.setOnClickListener(this);
		rel_06 = (RelativeLayout) this.findViewById(R.id.rel_06);
		rel_06.setOnClickListener(this);
		rel_07 = (RelativeLayout) this.findViewById(R.id.rel_07);
		rel_07.setOnClickListener(this);
		rel_08 = (RelativeLayout) this.findViewById(R.id.rel_08);
		rel_08.setOnClickListener(this);
		rel_09 = (RelativeLayout) this.findViewById(R.id.rel_09);
		rel_09.setOnClickListener(this);
		rel_10 = (RelativeLayout) this.findViewById(R.id.rel_10);
		rel_10.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		if(v.getId()==R.id.btnBack) {
			this.finish();
		} else if(v.getId()==R.id.rel_01) {
//			flag=1:我们的一家;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "1");
			intent.putExtra("titleName", "" + R.string.czda_main_01);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_02) {
//			flag=2:第一天上学;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "2");
			intent.putExtra("titleName", "" + R.string.czda_main_02);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_03) {
//			flag=3:精彩的瞬间;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "3");
			intent.putExtra("titleName", "" + R.string.czda_main_03);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_05) {
//			flag=5:舞台上的我;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "5");
			intent.putExtra("titleName", "" + R.string.czda_main_05);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_07) {
//			flag=7:得意的作品;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "7");
			intent.putExtra("titleName", "" + R.string.czda_main_07);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_09) {
//			flag=9:欢乐的课堂;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "9");
			intent.putExtra("titleName", "" + R.string.czda_main_09);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_10) {
//			flag=10:我的好朋友;
			Intent intent = new Intent(this,CZDAClientListPicMainAct.class);
			intent.putExtra("typeId", "10");
			intent.putExtra("titleName", "" + R.string.czda_main_10);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_04) {
//			flag=4:童言无忌;
			Intent intent = new Intent(this,CZDAClientListTxtMainAct.class);
			intent.putExtra("typeId", "4");
			intent.putExtra("titleName", "" + R.string.czda_main_04);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_06) {
//			flag=6:喜欢的故事;
			Intent intent = new Intent(this,CZDAClientListTxtMainAct.class);
			intent.putExtra("typeId", "6");
			intent.putExtra("titleName", "" + R.string.czda_main_06);
			startActivity(intent);
		} else if(v.getId()==R.id.rel_08) {
//			flag=8:教师评语;
			Intent intent = new Intent(this,CZDAClientListTxtMainAct.class);
			intent.putExtra("typeId", "8");
			intent.putExtra("titleName", "" + R.string.czda_main_08);
			startActivity(intent);
		}
	}

	@Override
	public void init() {
		
	}

	@Override
	public void refresh(Object... param) {
		
	}

	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}

}
